from flask import Flask, flash, jsonify, Response, render_template, request, session, redirect, url_for
import simplejson as json
from flask_session import Session
import hashlib
from apps.admin import app, db
from apps.admin.models.admin import Admin
from apps.admin.util import common


@app.route("/", methods=["GET", "POST"])
@app.route("/index", methods=["GET", "POST"])
def index():
    if session.get('isLogin') == 1:
        flash('You were successfully logged in')
        return render_template("index.html")

    if request.method == 'GET':
        return redirect(url_for('login'))